import { PropsWithChildren } from 'react';
import { useLaunch, useLoad, useUnload } from '@tarojs/taro';
import { useUserStore } from '@/business/store/user/login';
import './app.scss';
import { destroySdk, initSdk } from './utils/im';

function App({ children }: PropsWithChildren<any>) {

  useLaunch(() => {
    console.log('App launched');
    initSdk();
  });
  // Taro.clearStorageSync()
  useUnload(() => {
    destroySdk();
  });

  return children;
}

export default App;
